<template>
	<view>
		<view class="wrap">
			<image class="bg_img" :src="'/images/bg.png' | formatImgUrl" mode=""></image>
			<view class="head">
				<view class="tit">
					当前总粮币 <image :src="'/images/see.png' | formatImgUrl"></image>
				</view>
				<view class="money_num">
					4524枚
				</view>
				<view class="consumption">
					<view class="today">
						<view class="total_tit">
							今日消费(元)
						</view>
						<text class="num">4230.50</text>
					</view>
					<view class="today">
						<view class="total_tit">
							累计消费(元)
						</view>
						<text class="num">4230.50</text>
					</view>
				</view>
			</view>
			<view class="choose">
				<view class="item" v-for="(i,index) in chooseList" :key="index">
					<image :src="i.url | formatImgUrl" ></image>
					<text class="tit">{{i.text}}</text>
				</view>
			</view>
			
			<view class="discount">
				<view class="tit">
					<text class="title">优惠券</text>
					<view class="tip">
						<image :src="'/images/switch_icon.png' | formatImgUrl" class="icon"></image>
						可使用
					</view>
				</view>
				<view class="item">
					<view class="left">
						<view class="left_tit">
							<view class="name">
								满减优惠券
							</view>
							<view class="time">
								有效期至 <text>2045 - 11 -14</text>
							</view>
						</view>
						<view class="left_wrap">
							<view class="title_dic">
								<text class="num">50元</text>约稿红包
							</view>
							<view class="info_dic">
								新用户约稿畅享好礼，满500减55元，新用户约稿畅享好礼，满500减55元新用户约稿畅享好礼，满500减55元
							</view>
						</view>
					</view>
					<view class="right">
						待使用
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				chooseList:[
					{
						url:'/images/property_icon1.png',
						text:'粮币充值'
					},
					{
						url:'/images/property_icon2.png',
						text:'交易明细'
					},
					{
						url:'/images/property_icon3.png',
						text:'充值记录'
					}
				]
			};
		}
	}
</script>

<style lang="scss">
	.wrap{
		width: 100%;
		height: 100vh;
		background: linear-gradient(180deg, #45C4B0 17%, #F2F5F2 57%);
		background-size: 100% 100%;
		position: relative;
		.bg_img{
			transform: rotate(10.5deg);
			position: absolute;
			left: 300rpx;
			top: 8rpx;
			z-index: 0;
		}
		.head{
			padding: 26rpx 30rpx;
			font-size: 32rpx;
			color: #fff;
			font-weight: 300;
			.tit{
				display: flex;
				align-items: center;
				image{
					width: 40rpx;
					height: 40rpx;
					object-fit: cover;
					margin-left: 8rpx;
				}
			}
			.money_num{
				font-size: 60rpx;
				font-weight: bold;
				color: #FFFFFF;
			}
			.consumption{
				display: flex;
				margin-top: 40rpx;
				.today{
					.total_tit{
						font-size: 24rpx;
						font-weight: 300;
						color: #FFFFFF;
					}
					.num{
						font-size: 28rpx;
						color: #FFFFFF;
					}
					&:nth-child(1){
						margin-right: 180rpx;
					}
				}
			}
		}
		.choose{
			margin: 40rpx 30rpx;
			height: 166rpx;
			border-radius: 24rpx;
			background-color: #fff;
			display: flex;
			justify-content: space-around;
			align-items: center;
			.item{
				display: flex;
				flex-direction: column;
				align-items: center;
				image{
					width: 76rpx;
					height: 76rpx;
					object-fit: cover;
					margin-bottom: 4rpx;
					border: 1rpx dotted #eee;
				}
				.tit{
					font-size: 24rpx;
					color: #3D3D3D;
				}
			}
		}
		.discount{
			margin: 0 30rpx 0;
			background: #fff;
			box-sizing: border-box;
			padding: 40rpx 30rpx;
			border-radius: 24rpx;
			.tit{
				display: flex;
				justify-content: space-between;
				align-items: center;
				.title{
					font-size: 32rpx;
					font-weight: bold;
					color: #3D3D3D;
				}
				.tip{
					font-size: 24rpx;
					color: #999999;
					display: flex;
					align-items: center;
					.icon{
						width: 32rpx;
						height: 32rpx;
						margin-right: 8rpx;
						border: 1rpx dotted #eee;
						object-fit: cover;
					}
				}
			}
			.item{
				width: 100%;
				height: 238rpx;
				background-color: #D8D8D8;
				position: relative;
				border-radius: 8rpx;
				overflow: hidden;
				margin-top: 20rpx;
				box-shadow: 0 3rpx 10rpx -1rpx #4A4A4A;
				.left{
					width: 568rpx;
					height: 238rpx;
					background: url('https://cdnauth.dreamyuewen.com/images/dic_bg.png') no-repeat;
					background-size: cover;
					position: absolute;
					top: 0;
					left: 0;
					z-index: 2;
					.left_tit{
						padding: 0 14rpx;
						height: 68rpx;
						display: flex;
						margin: 0 auto;
						justify-content: space-between;
						align-items: center;
						border-bottom: 1px dashed #d8d8d8;
						.name{
							font-size: 28rpx;
							font-weight: 500;
							color: #3D3D3D;
							position: relative;
							margin-left: 12rpx;
							&::before{
								 content: '';
								 width: 4rpx;
								 height: 32rpx;
								 border-radius: 96rpx;
								 background: #45C4B0;
								 position: absolute;
								 left: -14rpx;
									top: 5rpx;
							}
						}
						.time{
							font-size: 20rpx;
							color: #999999;
						}
					}
					.left_wrap{
						padding: 20rpx;
						.title_dic{
							font-size: 48rpx;
							font-weight: 500;
							color: #3D3D3D;
							.num{
								color: #45C4B0
							}
						}
						.info_dic{
							font-size: 28rpx;
							font-weight: 300;
							color: #999999;
							overflow:hidden; //超出的文本隐藏
							text-overflow:ellipsis; //溢出用省略号显示
							white-space:nowrap; //溢出不换行
						}
					}
				}
				.right{
					width: 74rpx;
					height: 100%;
					background-color: #45C4B0;
					position: absolute;
					top: 0;
					right: 0;
					z-index: 1;
					font-size: 28rpx;
					font-weight: bold;
					text-align: center;
					color: #FFFFFF;
					letter-spacing: 8rpx;
					writing-mode: vertical-rl;
					padding-right: 10rpx;
				}
			}
		}
	}
	
</style>
